menuList[2].onclick();


// 点击返回上一页
function returnFun(){
    window.history.back();  
}
var userid;
//询问是否通过或下架一个商品
function openPassGoodsFun(e){
    e=e || window.event;
    var target=e.target || e.srcElement;
    // goodsid = target.getAttribute("name")
    userid = target.getAttribute("userid")
    let flag = target.getAttribute("flag");
    if(flag!=1){
        pointFun({
            code:14,
            msg:"是否通过该用户的审核"
        })
    }else{
        pointFun({
            code:15,
            msg:"是否拒绝该用户的审核"
        })
    }
} 
// function alertInputs(){
//     var str = prompt("请输入拒绝理由");
//     if(str){
//         alert(str);
//     }
// }
function passRealNameFun(){
    axios({
        url:'/admin/users/passARealName',
        method:'GET',
        params:{
            userId :userid 
        }
    })
    .then(data => {
        console.log(data);
        if(data.data.code==20000){
            closeFun();
            explain({
                code:1,
                msg:"通过审核成功",
                time:3000
            })
            window.location.reload();
        }
    })
    .catch(err => {
        console.log(err);
    })
}
// 打开商品下架理由面板
// function openUndercarriageGoodsFun(e){
//     e=e || window.event;
//     var target=e.target || e.srcElement;
//     goodsid = target.getAttribute("name")
//     userid = target.getAttribute("userid")
//     console.log(userid);
//     let flag = target.getAttribute("flag");
//     if(flag==1){
//         pointFun({
//             code:10,
//             msg:"是否通过该商品的审核"
//         })
//     }
// }
// 拒绝用户的实名申请
function refuseRealNameFun(){
    console.log(userid);
    axios({
        url:'/admin/users/refuseARealName',
        method:'GET',
        params:{
            // goodsId:goodsid,
            // comment :reasonWrap.value,
            userId :userid 
        }
    })
    .then(data => {
        console.log(data);
        if(data.data.code==20000){
            closeFun();
            explain({
                code:1,
                msg:"拒绝成功",
                time:3000
            })
            window.location.reload();
        }
    })
    .catch(err => {
        console.log(err);
    })
}
function closeFunUser(){
    // let reasonWin = cl("reasonWin");
    let covers = cl("covers");
    // reasonWin.style.display="none"
    covers.style.display="none"
}